{
 "metadata": {
  "name": "ex_keithley195"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "InstrumentKit Library Examples"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Keithley 195 Multimeter"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "In this example, we will demonstrate how to connect to a Keithley 195\n",
      "multimeter and transfer a single reading to the PC."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "We start by importing the InstrumentKit package."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import instruments as ik"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Next, we open our connection to the instrument. Here we use the \n",
      "Keithley195 class and open the connection using Galvant Industries'\n",
      "GPIBUSB adapter. Our connection is made to the virtual serial port located at\n",
      "/dev/ttyUSB0 and GPIB address 16."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "dmm = ik.keithley.Keithley195.open_gpibusb('/dev/ttyUSB0', 1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Now, we retreive the measurement currently displayed on the front panel."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print dmm.measure()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}